package flatlandRPGTest;

import org.lwjgl.util.vector.Vector2f;
import flatlandRPG.GLPrimitive;
import flatlandRPG.GLRectangle;

// -------------------------------------------------------------------------
/**
 * Tests the GLRectangle class.
 *
 * @author evant
 * @version Apr 15, 2011
 */
public class GLRectangleTest
    extends AbstractGLPrimitiveTest
{
    private GLRectangle testRect; // A test rectangle

    /**
     * Sets up the test case. This is called before each test method.
     */
    public void setUp() {
        super.setUp();
        testRect = (GLRectangle)getPrimitive();
    }

    /**
     * Returns a new GLRectangle for GLPrimative test cases.
     */
    @Override
    public GLPrimitive getPrimitive()
    {
        return new GLRectangle(1, 1);
    }

    // ----------------------------------------------------------
    /**
     * Tests the constructor of GLRectangle.
     */
    public void testConstructor()
    {
        testRect = new GLRectangle(1, 2);
        assertEquals(1, testRect.getWidth(), 0.0001);
        assertEquals(2, testRect.getHeight(), 0.0001);
    }

    public Vector2f getInnerPoint()
    {
        return new Vector2f(0.0f, 0.0f);
    }

    public Vector2f getOuterPoint()
    {
        return new Vector2f(-10.0f, -10.0f);
    }
}
